"""
练习: 学生有如下属性：姓名，年龄，性别，电脑 ， 学生通过电脑学习（学生拥有学习的方法）
"""
import time


class Computer:
    def __init__(self, brand):
        self.brand = brand

    def start(self):
        print(f'{self.brand}牌子的电脑开机了')

    def off(self):
        print(f'{self.brand}牌子的电脑关机了')


class Student:
    def __init__(self, name, age,gender,brand):
        self.name = name
        self.age = age
        self.gender = gender
        self.computer = Computer(brand)

    def study(self):
        print(f'{self.name}准备上网课了')
        self.computer.start()
        time.sleep(5)
        print('下课了')
        self.computer.off()

if __name__ == '__main__':
    s1 = Student('李欣桐','18','女','联想')
    s1.study()

    s2 = Student('谭新宇','19','女','华为')
    s2.study()